import axios from '@/libs/api.request'

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = info => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}


export const getCategory = data => {
  return axios.request({
    url: 'category/index',
    data,
    method: 'get',
    headers: {
      platform: 0
    }
  })
}
export const getWebCategory = data => {
  return axios.request({
    url: 'category/index',
    data,
    method: 'get',
    headers: {
      platform: 1
    }
  })
}


export const addCategory = data => {
  return axios.request({
    url: 'category/store',
    data,
    method: 'post',
    headers: {
      platform: data.platform
    }
  })
}
export const removeCategory = data => {
  return axios.request({
    url: 'category/remove',
    data,
    method: 'get'
  })
}
export const categoryDetail = data => {
  return axios.request({
    url: 'category/detail',
    data,
    method: 'get'
  })
}



export function getToken() {
  return axios.request({
    url: 'qiniu/getToken', // 假地址 自行替换
    method: 'get'
  })
}

